<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>

    <style>
        .a:after {
            content: "";
            display: block;
            clear: both;
        }
    </style>
</head>

<body>

    <div class="a">
        <div class="a1"></div>
        <div class="a2"></div>
        <!-- 代码冗余 -->
        <div style="clear:both;"></div>
    </div>

</body>

</html>